package com.songaw.cangku;

import com.songaw.cangku.pojo.entity.AppAccount;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 该注解指定项目为springboot，由此类当作程序入口 自动装配 web 依赖的环境
 * 
 */

@EnableCaching
@SpringBootApplication
public class SpringbootApplication /*extends SpringBootServletInitializer */{
	@RequestMapping("/test")

	@ResponseBody
	public AppAccount test() {
		AppAccount account = new AppAccount();

		account.setUuid("dd1");
		account.setEmplno("admin");
		account.setPassword("admin");

		// 模拟异常
		return account;
	}
	@Bean
	public BCryptPasswordEncoder bCryptPasswordEncoder() {
		return new BCryptPasswordEncoder();
	}
	/** tomcat里面运行 **/
/*	@Override
	protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
		return application.sources(SpringbootApplication.class);
	}*/

	public static void main(String[] args) {

		SpringApplication.run(SpringbootApplication.class, args);

	}

}
